#!/usr/bin/env node

import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';

yargs(hideBin(process.argv))
  .command({
    command: 'hello [name]',
    description: '向指定的人打招呼',
    handler(argv) {
      const name = argv.name || '陌生人';
      const now = new Date()
      console.clear()
      console.log(`\n北京时间${now.getHours()}点${now.getMinutes()}分\n`)
      console.log(`Hello，${name}！`);
    }
  })
  .help()
  .parse();